Component({
    properties: {
        datas: {
            type: null
        },
        component_id: {
            type: null
        }
    },
    data: {
        emptyImage: "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/image.png",
        clientWidth: "375",
        markers: [],
        scaleData: 16
    },
    lifetimes: {
        attached: function() {},
        moved: function() {},
        detached: function() {}
    },
    attached: function() {},
    ready: function() {
        var t = [];
        t.push({
            title: this.data.datas.business_title,
            id: this.data.component_id,
            latitude: this.data.datas.map_position.lat,
            longitude: this.data.datas.map_position.lng,
            iconPath: "https://webapi.amap.com/theme/v1.3/markers/n/mark_b.png",
            width: 20,
            height: 25,
            callout: {
                padding: "10rpx",
                borderRadius: "5rpx",
                content: this.data.datas.business_title
            }
        }), this.setData({
            markers: t,
            clientWidth: wx.getSystemInfoSync().windowWidth
        });
    },
    pageLifetimes: {
        show: function() {},
        hide: function() {},
        resize: function() {}
    },
    methods: {
        addressButton: function() {
            var t = Number(this.data.datas.map_position.lat), a = Number(this.data.datas.map_position.lng), i = this.data.datas.business_title;
            wx.openLocation({
                latitude: t,
                longitude: a,
                scale: 16,
                name: i
            });
        },
        phoneButton: function() {
            var t = this.data.datas.phone_title;
            wx.makePhoneCall({
                phoneNumber: t
            });
        }
    }
});